/*
 * File Name：Repeat.java
 * Copyright：Copyright 2008-2015 CiWong.Inc. All Rights Reserved.
 * Description： Repeat.java
 * Modify By：bin
 * Modify Date：2015年1月20日
 * Modify Type：Add
 */
package com.ciwong.epaper.modules.epaper.bean;

import com.ciwong.mobilelib.bean.BaseBean;
import com.google.gson.Gson;

import java.util.Comparator;

/**
 * 答案
 *
 * @author bin
 * @version ciwong v.1.0 2015年1月20日
 * @since ciwong v.1.0
 */
public class VideoRecord extends BaseBean {

    private static final long serialVersionUID = -4971291002220284772L;

    /**
     * 作业实际得分
     */
    public float actualScore;

    /**
     * 资源名称
     */
    private String resourceName;

    /**
     * 资源版本ID
     */
    private String versionId;

    /**
     * 作业用时(秒)
     */
    private int workLong;

    /**
     * 作业参考总分值
     */
    public float workScore;

    /**
     * 提交时间
     */
    private long submitDate;

    /**
     * 做作业ID
     */
    private String doWorkId;

    /**
     * 视频资源url
     */
    private String videoUrl;

    /**
     * 配音记录合成视频
     */
    private String dubbingVideoUrl;

    /**
     * 视频封面
     */
    private String cover;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public float getActualScore() {
        return actualScore;
    }

    public void setActualScore(float actualScore) {
        this.actualScore = actualScore;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getVersionId() {
        return versionId;
    }

    public void setVersionId(String versionId) {
        this.versionId = versionId;
    }

    public int getWorkLong() {
        return workLong;
    }

    public void setWorkLong(int workLong) {
        this.workLong = workLong;
    }

    public float getWorkScore() {
        return workScore;
    }

    public void setWorkScore(float workScore) {
        this.workScore = workScore;
    }

    public long getSubmitDate() {
        return submitDate;
    }

    public void setSubmitDate(long submitDate) {
        this.submitDate = submitDate;
    }

    public String getDoWorkId() {
        return doWorkId;
    }

    public void setDoWorkId(String doWorkId) {
        this.doWorkId = doWorkId;
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }

    public String getDubbingVideoUrl() {
        return dubbingVideoUrl;
    }

    public void setDubbingVideoUrl(String dubbingVideoUrl) {
        this.dubbingVideoUrl = dubbingVideoUrl;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    @Override
    public String toString() {
        return new Gson().toJson(this);
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || !(o instanceof VideoRecord)) {
            return false;
        }
        return _id == ((VideoRecord) o).get_id();
    }

    public static class videoRecordComparator implements Comparator<VideoRecord> {

        @Override
        public int compare(VideoRecord lhs, VideoRecord rhs) {
            if (lhs == null || rhs == null) {
                return 0;
            }
            return (int) (lhs.getActualScore() - rhs.getActualScore());
        }
    }
}
